package Exception;

public class demo2 {
    public static void main(String[] args) {
        int []arr = {1,2,3,4};
        try {
            System.out.println(2/0);
            System.out.println(arr[10]);
        } catch (ArithmeticException e ) {
            System.out.println("除数不能为0");
        }catch (ArrayIndexOutOfBoundsException e){
            System.out.println("索引越界");
        }
        System.out.println("看看");
    }
}
